#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Copyright 2025 Huawei Technologies Co., Ltd
import os
import numpy as np


def gen_golden_data_simple():
    dtype = np.float16
    output_shape = [5, 5]
    input_data = np.random.uniform(1, 4, output_shape).astype(dtype)
    input_x1 = np.random.uniform(1, 4, output_shape).astype(dtype)
    input_x2 = np.random.uniform(1, 4, output_shape).astype(dtype)
    input_value = np.random.uniform(1, 4, [1]).astype(dtype)
    if dtype == np.int32:
        input_value[0] = 2
    else:
        input_value[0] = 1.2
    golden = (input_data + input_x1 * input_x2 * input_value).astype(dtype)
    os.system("mkdir -p input")
    os.system("mkdir -p output")
    # 将数据保存为文本文件
    np.savetxt("./input/input_data.txt", input_data.flatten(), fmt='%.6f')
    np.savetxt("./input/input_x1.txt", input_x1.flatten(), fmt='%.6f')
    np.savetxt("./input/input_x2.txt", input_x2.flatten(), fmt='%.6f')
    np.savetxt("./input/input_value.txt", input_value.flatten(), fmt='%.6f')
    np.savetxt("./output/golden.txt", golden.flatten(), fmt='%.6f')

if __name__ == "__main__":
    gen_golden_data_simple()